package com.sphd.restaurantsystem.presenter;


import com.android.volley.VolleyError;
import com.sphd.restaurantsystem.model.RestaurantModelImpl;
import com.sphd.restaurantsystem.view.RestaurantView;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
* Created by Hu on 2017/01/13
*/

public class RestaurantPresenterImpl implements RestaurantPresenter {
    RestaurantModelImpl restaurantModel;
    RestaurantView restaurantView;

    public RestaurantPresenterImpl(RestaurantView restaurantView) {
        this.restaurantView = restaurantView;
        restaurantModel=new RestaurantModelImpl();
    }

    @Override
    public void addData(String url) {

    }

    @Override
    public void sendError(VolleyError error) {
        restaurantView.dissLoading();
    }

    @Override
    public void sendUp(String url, String image, List<File> fileList, Map<String, String> map) {
        restaurantView.showLoading();
        restaurantModel.sendUp(url,image,fileList,map,this);
    }

    @Override
    public void sendUpNoImage(String url, Map<String, String> map) {
        restaurantView.showLoading();
        restaurantModel.sendUpNoImage(url,map,this);
    }

    @Override
    public void sendRes(int res) {
        restaurantView.recRes(res);
        restaurantView.dissLoading();
    }
}